home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-10-09 | 1.9 KB | 83 lines | [TEXT/MPS ] |
- {*******************************************************************************
- MTest.p
- This minor extension to Apple's Nothing example throws up a dialog to
- demonstrate the use of the TDateEditText, TTimeEditText, and TDateCluster
- classes.
- *******************************************************************************}
-
- PROGRAM Test;
-
- {$MC68020-} { The main program must be universal code }
- {$MC68881-}
-
- USES
- { • MacApp }
- UMacApp,
-
- { • Building Blocks }
- UPrinting,
- UDialog,
-
- { • Implementation use }
- Packages,
- Script,
-
- { • Application Units }
- UDateTimeUtilities,
- UValidText,
- UDateTimeText,
- UTest,
- UTEView;
-
- {---------------------------------------------------------------------------
- Main Program
- This is the standard main program; nothing fancy here.
- ---------------------------------------------------------------------------}
-
- CONST
- kSplash = 3001; { Application's splash screen }
-
- VAR
- gTestApplication: TTestApplication; { The application object }
- theDialog: DialogPtr; { the splash screen }
-
- BEGIN
- InitToolBox;
-
- { Pull app to front under MultiFinder™; required for splash screen }
- PullApplicationToFront;
-
- IF ValidateConfiguration(gConfiguration)
- THEN
- BEGIN
- { before initializing MacApp, throw up a splash screen }
- theDialog := GetNewCenteredDialog(kSplash, NIL, WindowPtr(-1));
- IF theDialog <> NIL
- THEN
- DrawDialog(theDialog); { display splash dialog }
-
- { start MacApp initialization }
- InitUMacApp(8);
- InitUDialog;
- InitUPrinting;
- InitUTEView;
-
- { initialize application units }
- InitUDateTimeUtilities;
- InitUValidText;
- InitUDateTimeText(shortDate);
-
- New(gTestApplication);
- FailNIL(gTestApplication);
- gTestApplication.ITestApplication(kFileType);
-
- IF theDialog <> NIL
- THEN
- DisposDialog(theDialog); { remove splash dialog }
-
- gTestApplication.Run;
- END
- ELSE
- StdAlert(phUnsupportedConfiguration);
- END. { main }
-